package com.borya.action.server;

import org.apache.log4j.Logger;

import com.alibaba.fastjson.JSONObject;
import com.borya.action.BaseAction;
import com.borya.framework.annotation.Action;
import com.borya.framework.annotation.Autowired;
import com.borya.framework.annotation.JsonResult;
import com.borya.framework.annotation.UrlMapping;
import com.borya.framework.core.ServerRequest;
import com.borya.framework.core.ServerResponse;
import com.borya.service.server.SendMailService;
@UrlMapping("/s/user/")
@Action
public class SendMailAction extends BaseAction{
	private Logger log = Logger.getLogger(getClass());
	@Autowired("sendMailServiceImpl")
	private SendMailService sendMailService;
	
	public SendMailService getSendMailService() {
		return sendMailService;
	}

	@UrlMapping("sendMail")
	@JsonResult
	public String sendMail(ServerRequest request,ServerResponse response) {
		log.info("RECV :"+request.text());
		JSONObject json = getJson(request);
		String result = getSendMailService().sendMail(json);;
		log.info("INFO[" + json + "],OUT[" + result + "]");
		return result;
	}
}
